package com.swgk.core.view.areapopup;

import com.contrarywind.interfaces.IPickerViewData;
import com.google.gson.annotations.SerializedName;

import org.jetbrains.annotations.NotNull;

import java.io.Serializable;

public class AddressEntity<T> extends PickSelectEntity2 implements IPickerViewData , Serializable {
    @SerializedName("id")
    private String id;
    @SerializedName(value = "children", alternate = {"childrenList"})
    private T children;

    //自定字段，列表中下标
    private int index;

    public AddressEntity() {
    }

    public AddressEntity(String id, String name, String no, String simpleName) {
        super(no,name);
        this.id = id;
        this.simpleName=simpleName;
    }
    public AddressEntity(String id, String name, String no) {
        super(no,name);
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public T getChildren() {
        return children;
    }

    public void setChildren(T children) {
        this.children = children;
    }

    public String getSimpleName() {
        return simpleName;
    }

    public void setSimpleName(String simpleName) {
        this.simpleName = simpleName;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    @Override
    public String getPickerViewText() {
        return getName();
    }

    @NotNull
    @Override
    public String toString() {
        return "AddressEntity{" +super.toString()+
                "id='" + id + '\'' +
                ", children=" + children +
                ", parentNo='" + getName() + '\'' +
                '}';
    }
}
